home *** CD-ROM | disk | FTP | other *** search
- /****
- * CATalkPane.c
- *
- * Pane methods for a typical application.
- *
- * Copyright © 1990 Symantec Corporation. All rights reserved.
- *
- ****/
-
- #include <CScrollPane.h>
-
- /**
- *
- * Most applications will want a scrollable window, so this
- * class is based on the class CPanorama. All the methods here
- * would still apply to classes based directly on CPane.
- *
- **/
-
- #include "CATalkPane.h"
-
-
- void CATalkPane::IATalkPane(CView *anEnclosure, CBureaucrat *aSupervisor,
- short aWidth, short aHeight,
- short aHEncl, short aVEncl,
- SizingOption aHSizing, SizingOption aVSizing)
- {
- CPane::IPane(anEnclosure, aSupervisor, aWidth, aHeight,
- aHEncl, aVEncl, aHSizing, aVSizing);
-
- topPane = bottomPane = nil;
- }
-
-
- void CATalkPane::SetSubPanes(CPane *top, CPane *bottom)
- {
- topPane = top;
- bottomPane = bottom;
- }
-
- /***
- * ChangeSize
- *
- * change the sizes of the two inner panes accordingly
- ***/
- void CATalkPane::ChangeSize(Rect *delta, Boolean redraw)
- {
- long vdif = delta->bottom - delta->top;
- long halfv = vdif / 2;
- Rect topdelta = *delta;
- Rect bottomdelta = *delta;
-
- inherited::ChangeSize(delta, redraw);
-
- // these were taken care of in inherited::
- topdelta.right = topdelta.left = 0;
- bottomdelta.right = bottomdelta.left = 0;
-
- if (topPane && bottomPane)
- {
- topdelta.bottom = halfv;
- bottomdelta.top = halfv;
- bottomdelta.bottom = vdif;
-
- topPane->ChangeSize(&topdelta, redraw);
- bottomPane->ChangeSize(&bottomdelta, redraw);
- }
- }